package com.beibie.yunpicturebackend.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.beibie.yunpicturebackend.model.dto.user.UserQueryRequest;
import com.beibie.yunpicturebackend.model.entity.User;
import com.beibie.yunpicturebackend.model.vo.LoginUserVO;
import com.beibie.yunpicturebackend.model.vo.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author admin
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2025-02-20 16:39:09
*/
public interface UserService extends IService<User> {

     /**
     * 用户注册
     * @param userAccount
     * @param userPassword
     * @param checkPassword
     * @return
     */
     long userRegister(String userAccount, String userPassword, String checkPassword);


     /**
     * 用户登录
     * @param userAccount
     * @param userPassword
     * @param request
     * @return 脱敏后的用户信息
     */
     LoginUserVO userLogin(String userAccount, String userPassword, HttpServletRequest request);

     /**
     * 获取加密后的密码
     * @param password
     * @return
     */
     String getEncryptPassword(String password);

     /**
     * 获取脱敏类的用户信息
     * @param user
     * @return
     */
     LoginUserVO getLoginUserVO(User user);



     /**
     * 获取当前登录用户
     * @param request
     * @return
     */
    User getLoginUser(HttpServletRequest request);




     /**
      * 用户注销
      * @param request
      * @return
      */
     Boolean userLogout(HttpServletRequest request);


    /**
     *获得脱敏后的用户信息
     * @param user
     * @return 脱敏后的用户列表
     * @author beibie
     */

   UserVO getUserVO(User user);

   /**
    * 获得脱敏后的用户信息列表
    * @param userList
    * @return
    * @author beibie
    */
    List<UserVO> getUserVOList(List<User> userList);


/**
 * 获取查询条件
 * @param queryRequest
 * @return
 */
    QueryWrapper<User> getQueryWrapper(UserQueryRequest queryRequest);


    /**
     * 是否为管理员
     *
     * @param user
     * @return
     */
    boolean isAdmin(User user);


}
